package com.rppowell.pixie.swing.spriteset;

import com.rppowell.pixie.models.Sprite;
import java.awt.BorderLayout;

import javax.swing.JPanel;

import com.rppowell.pixie.models.SpriteSet;
import com.rppowell.pixie.swing.PixieUIState;

public class SpriteSetPanel extends JPanel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
        private SpriteSet spriteSet;
	private SpriteSetWorkArea spriteSetWorkArea;
	private SpriteSetListPanel spriteSetListPanel;
	
	public SpriteSetPanel(SpriteSet s) {
                spriteSet = s;
		setLayout(new BorderLayout());
		spriteSetWorkArea = new SpriteSetWorkArea(s);
		add(spriteSetWorkArea, BorderLayout.CENTER);
		spriteSetListPanel = new SpriteSetListPanel(s);
		add(spriteSetListPanel, BorderLayout.SOUTH);
	}
        
        public SpriteSet getSpriteSet() {
            return spriteSet;
        }

	public void setPixieUIState(PixieUIState state) {
		spriteSetWorkArea.setPixieUIState(state);
	}
        
        public void setSelectedSprite(Sprite s) {
            spriteSetWorkArea.setSelectedSprite(s);
            //spriteSetListPanel.selectSprite(s);
        }

}
